You are currently viewing Programming Basics #31 Working with Arrays

Programming Basics #31 Working with Arrays

  • Post author:
  • Post category:Videos

http://learn-share.net/programming-basics-course/
Working with Arrays – The Basics of Programming #31
Working with arrays

What is an Array. An Array is a collection of values, all wrap up, and give it a name.

We already know how to create one variable at a time. We use the word var, we give it a name, and then we can use the equal sign to give that variable a value.

Could be a letter, a number, or could be a string or a boolean, but it’s one value.

Now an array, is the idea of multiple values, but contained in one named variable. Such this one. A variable called my array, with multiple values in it.

This is a great way to keep data together, that belongs together. To keep dozens, or thousands peaces of information together, without having to name every single individual peace as an individual variable.

Now, a few concepts before we make one.

All we have is one name, for this entire array, how do we get individual peaces in or out.

In an array, each individual value, are refered as an element, a number, a index that identifies where it is in the array.

Arrays have internal order, they don’t mix they values randomly.

So the first slot, have an index of zero, the second position, have an index of one, and so on.